<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script src="https://cdn.jsdelivr.net/npm/vue@2.6.14/dist/vue.js"></script>
    <div id="app">
        <!-- 遍历的时候都加上:key来区分不通的数据，提高vue渲染效率 -->
        <ul>
            <li v-for="user in users" :key="user.name">
                {{user.name}}==>{{user.gender}}==>{{user.age}}

            </li>
            <br>

            <li v-for="(user,index) in users" :key="index">
                当前索引：{{index}}==>{{user.name}}==>{{user.gender}}==>{{user.age}}
                <br />
                对象信息1：
                <br />
                <span v-for="v in user">
                    {{v}}==>
                </span>
                <br />
                ==================
                <br />
                对象信息2：
                <br />
                <span v-for="(v,k) in user">
                    {{k}}=={{v}}
                    <br />
                </span>
                ==================
                <br />
                对象信息3：
                <br />
                <span v-for="(v,k,i) in user" :key="i">
                    {{i}}=={{k}}=={{v}}
                    <br />
                </span>
            </li>
            <br />

        </ul>

    </div>
    <script>
        let vm = new Vue({
            el: "#app",
            data: {
                users: [
                    { name: "张1", gender: "男", age: 18 },
                    { name: "张2", gender: "男", age: 19 },
                    { name: "张3", gender: "女", age: 20 },
                    { name: "张4", gender: "男", age: 21 }
                ]


            }
        });
    </script>
</body>

</html>